#!/usr/bin/env bash
# 循环读取文件内容
file="states"
for state in $(cat $file)
do
    echo "Visit beautiful $state"
done

# 通配符匹配目录
for file in /home/rich/test/*
do
    if [ -d "$file" ]
    then
        echo "$file is a directory"
    elif [ -f "$file" ]
        then
         echo "$file is a file"
    fi
done

# for 利用计数器循环，注意赋值等号前后不需要空格
for (( a=1, b=10; a <= 10; a++, b-- ))
do
    echo "$a - $b"
done